package com.xktpx.service;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.xktpx.common.utils.PageUtils;
import com.xktpx.entity.BuyOrderEntity;
import com.xktpx.entity.model.BuyOrder;
import com.xktpx.entity.model.OfferPurchaseDto;
import com.xktpx.entity.model.OrderGoods;
import com.xktpx.entity.model.SaleGoods;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 购买订单信息表
 *
 * @author yhao
 * @email 102126854@qq.com
 * @date 2019-01-01 00:24:48
 */
public interface BuyOrderService extends IService<BuyOrderEntity> {

    PageUtils queryPage(Map<String, Object> params);

    Page<OrderGoods> queryListByGoodsId(Integer goodsId, Integer buyType, Integer sizeId, Integer pageNo, Integer pageSize);

    /**
     * 查询商品最高求购价格按规格分
     * @param goodsId id
     * @return list
     */
    List<SaleGoods> querySaleGoodsAmountOrderBySize(Integer goodsId);

    /**
     * 商品最最低售价  按规格分
     * @param goodsId goodsId
     * @return list
     */
    List<SaleGoods> queryBuyGoodsAmountOrderBySize(Integer goodsId);

    /**
     * 商品最低已成交价格
     * @param goodsId goodsId
     * @param sizeId sizeId
     * @return list
     */
    SaleGoods queryBuyOrderAmountByGoodsSize(Integer goodsId, Integer sizeId);

    List<OfferPurchaseDto> offerPurchaseList(@Param("goodsId")Integer goodsId);

    void buyerCreateOrder(BuyOrder buyOrder);

    void offerPurchaseCreateOrder(BuyOrder buyOrder);

    BuyOrderEntity selectlatestBuyOrder(Integer goodsId);
}

